<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::util::Process_credentials Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Public API.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1util.html">util</a></li><li class="navelem"><a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#related">Related Functions</a> &#124;
<a href="classipc_1_1util_1_1Process__credentials-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipc::util::Process_credentials Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>A process's credentials (PID, UID, GID as of this writing).  
 <a href="classipc_1_1util_1_1Process__credentials.html#details">More...</a></p>

<p><code>#include &lt;process_credentials.hpp&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ipc::util::Process_credentials:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classipc_1_1util_1_1Process__credentials__inherit__graph.svg" width="204" height="143"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3840b767894abdd17cf9a7b5b2dfbf3c"><td class="memItemLeft" align="right" valign="top"><a id="a3840b767894abdd17cf9a7b5b2dfbf3c" name="a3840b767894abdd17cf9a7b5b2dfbf3c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Process_credentials</b> ()</td></tr>
<tr class="memdesc:a3840b767894abdd17cf9a7b5b2dfbf3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default ctor: each value is initialized to zero or equivalent. <br /></td></tr>
<tr class="separator:a3840b767894abdd17cf9a7b5b2dfbf3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7794dc1a6d963cdd10928fb69008df14"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a7794dc1a6d963cdd10928fb69008df14">Process_credentials</a> (<a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a> process_id_init, <a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a> user_id_init, <a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a> group_id_init)</td></tr>
<tr class="memdesc:a7794dc1a6d963cdd10928fb69008df14"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ctor that sets the values explicitly.  <a href="classipc_1_1util_1_1Process__credentials.html#a7794dc1a6d963cdd10928fb69008df14">More...</a><br /></td></tr>
<tr class="separator:a7794dc1a6d963cdd10928fb69008df14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c7e32527927afdf2d7b46e2aa9a82b6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a3c7e32527927afdf2d7b46e2aa9a82b6">Process_credentials</a> (const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;src)</td></tr>
<tr class="memdesc:a3c7e32527927afdf2d7b46e2aa9a82b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Boring copy ctor.  <a href="classipc_1_1util_1_1Process__credentials.html#a3c7e32527927afdf2d7b46e2aa9a82b6">More...</a><br /></td></tr>
<tr class="separator:a3c7e32527927afdf2d7b46e2aa9a82b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f507637515a11b2f7e50959a8a39ce2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a8f507637515a11b2f7e50959a8a39ce2">operator=</a> (const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;src)</td></tr>
<tr class="memdesc:a8f507637515a11b2f7e50959a8a39ce2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Boring copy assignment.  <a href="classipc_1_1util_1_1Process__credentials.html#a8f507637515a11b2f7e50959a8a39ce2">More...</a><br /></td></tr>
<tr class="separator:a8f507637515a11b2f7e50959a8a39ce2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a181288d97adcadedf187d08c71045854"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854">process_id</a> () const</td></tr>
<tr class="memdesc:a181288d97adcadedf187d08c71045854"><td class="mdescLeft">&#160;</td><td class="mdescRight">The process ID (PID).  <a href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854">More...</a><br /></td></tr>
<tr class="separator:a181288d97adcadedf187d08c71045854"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1fb8e7a5663735405ca0c0bc29163c5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ac1fb8e7a5663735405ca0c0bc29163c5">user_id</a> () const</td></tr>
<tr class="memdesc:ac1fb8e7a5663735405ca0c0bc29163c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The user ID (UID).  <a href="classipc_1_1util_1_1Process__credentials.html#ac1fb8e7a5663735405ca0c0bc29163c5">More...</a><br /></td></tr>
<tr class="separator:ac1fb8e7a5663735405ca0c0bc29163c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae54faa2974b966d31678fd51b7200514"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae54faa2974b966d31678fd51b7200514">group_id</a> () const</td></tr>
<tr class="memdesc:ae54faa2974b966d31678fd51b7200514"><td class="mdescLeft">&#160;</td><td class="mdescRight">The group user ID (GID).  <a href="classipc_1_1util_1_1Process__credentials.html#ae54faa2974b966d31678fd51b7200514">More...</a><br /></td></tr>
<tr class="separator:ae54faa2974b966d31678fd51b7200514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4f156cfdfe0c8c5702890e5c1a37cdf"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae4f156cfdfe0c8c5702890e5c1a37cdf">process_invoked_as</a> (<a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a> *err_code=0) const</td></tr>
<tr class="memdesc:ae4f156cfdfe0c8c5702890e5c1a37cdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtains, from the OS, information as to the binary name via which process <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854" title="The process ID (PID).">process_id()</a> was started, per its command line, namely <code>argv[0]</code>.  <a href="classipc_1_1util_1_1Process__credentials.html#ae4f156cfdfe0c8c5702890e5c1a37cdf">More...</a><br /></td></tr>
<tr class="separator:ae4f156cfdfe0c8c5702890e5c1a37cdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a18c901aeeed11c91afcc6379260f02a5"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a18c901aeeed11c91afcc6379260f02a5">own_process_id</a> ()</td></tr>
<tr class="memdesc:a18c901aeeed11c91afcc6379260f02a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtains the calling process's <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854" title="The process ID (PID).">process_id()</a>.  <a href="classipc_1_1util_1_1Process__credentials.html#a18c901aeeed11c91afcc6379260f02a5">More...</a><br /></td></tr>
<tr class="separator:a18c901aeeed11c91afcc6379260f02a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a14d2788f0aaf91042206d5f6e5cabd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9a14d2788f0aaf91042206d5f6e5cabd">own_user_id</a> ()</td></tr>
<tr class="memdesc:a9a14d2788f0aaf91042206d5f6e5cabd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtains the calling process's effective <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ac1fb8e7a5663735405ca0c0bc29163c5" title="The user ID (UID).">user_id()</a>.  <a href="classipc_1_1util_1_1Process__credentials.html#a9a14d2788f0aaf91042206d5f6e5cabd">More...</a><br /></td></tr>
<tr class="separator:a9a14d2788f0aaf91042206d5f6e5cabd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c4074f11192a1193afb019d04753cd2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9c4074f11192a1193afb019d04753cd2">own_group_id</a> ()</td></tr>
<tr class="memdesc:a9c4074f11192a1193afb019d04753cd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtains the calling process's effective <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae54faa2974b966d31678fd51b7200514" title="The group user ID (GID).">group_id()</a>.  <a href="classipc_1_1util_1_1Process__credentials.html#a9c4074f11192a1193afb019d04753cd2">More...</a><br /></td></tr>
<tr class="separator:a9c4074f11192a1193afb019d04753cd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a573d6de2f257144562fd55e0772991f1"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a573d6de2f257144562fd55e0772991f1">own_process_credentials</a> ()</td></tr>
<tr class="memdesc:a573d6de2f257144562fd55e0772991f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs and returns <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> containing values pertaining to the calling process at this time.  <a href="classipc_1_1util_1_1Process__credentials.html#a573d6de2f257144562fd55e0772991f1">More...</a><br /></td></tr>
<tr class="separator:a573d6de2f257144562fd55e0772991f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="related" name="related"></a>
Related Functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p >(Note that these are not member functions.) </p>
</td></tr>
<tr class="memitem:a4ccdab04a79159f82d7ade8136a2eeb2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a4ccdab04a79159f82d7ade8136a2eeb2">operator==</a> (const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;val1, const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;val2)</td></tr>
<tr class="memdesc:a4ccdab04a79159f82d7ade8136a2eeb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for by-value equality between two <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> objects.  <a href="classipc_1_1util_1_1Process__credentials.html#a4ccdab04a79159f82d7ade8136a2eeb2">More...</a><br /></td></tr>
<tr class="separator:a4ccdab04a79159f82d7ade8136a2eeb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf94b5903f4e0aa2f2699867dd8971ef"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#aaf94b5903f4e0aa2f2699867dd8971ef">operator!=</a> (const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;val1, const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;val2)</td></tr>
<tr class="memdesc:aaf94b5903f4e0aa2f2699867dd8971ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for by-value inequality between two <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> objects.  <a href="classipc_1_1util_1_1Process__credentials.html#aaf94b5903f4e0aa2f2699867dd8971ef">More...</a><br /></td></tr>
<tr class="separator:aaf94b5903f4e0aa2f2699867dd8971ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9da92514406dc1fc61f5a561c9b5aee9"><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9da92514406dc1fc61f5a561c9b5aee9">operator&lt;&lt;</a> (std::ostream &amp;os, const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;val)</td></tr>
<tr class="memdesc:a9da92514406dc1fc61f5a561c9b5aee9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints string representation of the given <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">util::Process_credentials</a> to the given <code>ostream</code>.  <a href="classipc_1_1util_1_1Process__credentials.html#a9da92514406dc1fc61f5a561c9b5aee9">More...</a><br /></td></tr>
<tr class="separator:a9da92514406dc1fc61f5a561c9b5aee9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >A process's credentials (PID, UID, GID as of this writing). </p>
<dl class="section see"><dt>See also</dt><dd>Opt_peer_process_credentials, a sub-class. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7794dc1a6d963cdd10928fb69008df14" name="a7794dc1a6d963cdd10928fb69008df14"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7794dc1a6d963cdd10928fb69008df14">&#9670;&nbsp;</a></span>Process_credentials() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::Process_credentials::Process_credentials </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a>&#160;</td>
          <td class="paramname"><em>process_id_init</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a>&#160;</td>
          <td class="paramname"><em>user_id_init</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a>&#160;</td>
          <td class="paramname"><em>group_id_init</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Ctor that sets the values explicitly. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">process_id_init</td><td>See <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854" title="The process ID (PID).">process_id()</a>. </td></tr>
    <tr><td class="paramname">user_id_init</td><td>See <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ac1fb8e7a5663735405ca0c0bc29163c5" title="The user ID (UID).">user_id()</a>. </td></tr>
    <tr><td class="paramname">group_id_init</td><td>See <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae54faa2974b966d31678fd51b7200514" title="The group user ID (GID).">group_id()</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3c7e32527927afdf2d7b46e2aa9a82b6" name="a3c7e32527927afdf2d7b46e2aa9a82b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c7e32527927afdf2d7b46e2aa9a82b6">&#9670;&nbsp;</a></span>Process_credentials() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ipc::util::Process_credentials::Process_credentials </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Boring copy ctor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae54faa2974b966d31678fd51b7200514" name="ae54faa2974b966d31678fd51b7200514"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae54faa2974b966d31678fd51b7200514">&#9670;&nbsp;</a></span>group_id()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a> ipc::util::Process_credentials::group_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The group user ID (GID). </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a8f507637515a11b2f7e50959a8a39ce2" name="a8f507637515a11b2f7e50959a8a39ce2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f507637515a11b2f7e50959a8a39ce2">&#9670;&nbsp;</a></span>operator=()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp; ipc::util::Process_credentials::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Boring copy assignment. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>*this</code>. </dd></dl>

</div>
</div>
<a id="a9c4074f11192a1193afb019d04753cd2" name="a9c4074f11192a1193afb019d04753cd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c4074f11192a1193afb019d04753cd2">&#9670;&nbsp;</a></span>own_group_id()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a3f7d069ce0d23f73153da2e2559dc3d3">group_id_t</a> ipc::util::Process_credentials::own_group_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Obtains the calling process's effective <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae54faa2974b966d31678fd51b7200514" title="The group user ID (GID).">group_id()</a>. </p>
<p >This value can be changed via OS calls. </p><dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a573d6de2f257144562fd55e0772991f1" name="a573d6de2f257144562fd55e0772991f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a573d6de2f257144562fd55e0772991f1">&#9670;&nbsp;</a></span>own_process_credentials()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> ipc::util::Process_credentials::own_process_credentials </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs and returns <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> containing values pertaining to the calling process at this time. </p>
<p >Note that certain values therein may become incorrect over time (see <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9a14d2788f0aaf91042206d5f6e5cabd" title="Obtains the calling process&#39;s effective user_id().">own_user_id()</a>, <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9c4074f11192a1193afb019d04753cd2" title="Obtains the calling process&#39;s effective group_id().">own_group_id()</a>).</p>
<dl class="section return"><dt>Returns</dt><dd><code><a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a>(<a class="el" href="classipc_1_1util_1_1Process__credentials.html#a18c901aeeed11c91afcc6379260f02a5" title="Obtains the calling process&#39;s process_id().">own_process_id()</a>, <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9a14d2788f0aaf91042206d5f6e5cabd" title="Obtains the calling process&#39;s effective user_id().">own_user_id()</a>, <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a9c4074f11192a1193afb019d04753cd2" title="Obtains the calling process&#39;s effective group_id().">own_group_id()</a>)</code>. </dd></dl>

</div>
</div>
<a id="a18c901aeeed11c91afcc6379260f02a5" name="a18c901aeeed11c91afcc6379260f02a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18c901aeeed11c91afcc6379260f02a5">&#9670;&nbsp;</a></span>own_process_id()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a> ipc::util::Process_credentials::own_process_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Obtains the calling process's <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854" title="The process ID (PID).">process_id()</a>. </p>
<p >This value will never change. </p><dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a9a14d2788f0aaf91042206d5f6e5cabd" name="a9a14d2788f0aaf91042206d5f6e5cabd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a14d2788f0aaf91042206d5f6e5cabd">&#9670;&nbsp;</a></span>own_user_id()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a> ipc::util::Process_credentials::own_user_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Obtains the calling process's effective <a class="el" href="classipc_1_1util_1_1Process__credentials.html#ac1fb8e7a5663735405ca0c0bc29163c5" title="The user ID (UID).">user_id()</a>. </p>
<p >This value can be changed via OS calls. </p><dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a181288d97adcadedf187d08c71045854" name="a181288d97adcadedf187d08c71045854"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a181288d97adcadedf187d08c71045854">&#9670;&nbsp;</a></span>process_id()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a0c44028a45451ebf21f6af8e806b2682">process_id_t</a> ipc::util::Process_credentials::process_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The process ID (PID). </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="ae4f156cfdfe0c8c5702890e5c1a37cdf" name="ae4f156cfdfe0c8c5702890e5c1a37cdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4f156cfdfe0c8c5702890e5c1a37cdf">&#9670;&nbsp;</a></span>process_invoked_as()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string ipc::util::Process_credentials::process_invoked_as </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89">Error_code</a> *&#160;</td>
          <td class="paramname"><em>err_code</em> = <code>0</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Obtains, from the OS, information as to the binary name via which process <a class="el" href="classipc_1_1util_1_1Process__credentials.html#a181288d97adcadedf187d08c71045854" title="The process ID (PID).">process_id()</a> was started, per its command line, namely <code>argv[0]</code>. </p>
<p >In simplified terms this is the executable of <code>*this</code> process; however there are important properties to consider about this information:</p><ul>
<li>The process must be currently executing. If it is not, a no-such-file error is emitted.</li>
<li>The executable name is as-it-appeared on the command line; e.g., it might be a relative and/or un-normalized and/or a symlink. It is only the normalized, absolute path if that is how it was invoked.</li>
<li>It is possible (not common but not non-existent either) for a process to change its own command line upon execution; in this case there's almost no limit to what string might result. Note! Even an empty returned string is possible; and this is not emitted as an error.</li>
</ul>
<p >Because of these facts we feel it is, informally, best to use this information for one of these use cases:</p><ul>
<li>logging;</li>
<li>verification against an expected value, especially when safety-checking against an expected policy (e.g., against <a class="el" href="structipc_1_1session_1_1App.html#ae82a8635858664720c8546e468f8090b" title="Absolute, lexically normalized canonical path to the executable entity (which is not a directory),...">session::App::m_exec_path</a>) &ndash; namely that, say, the given process was (1) an instance of a specific application and (2) was invoked via its normalized, absolute path.</li>
</ul>
<p >For these cases it should be reasonable to use.</p>
<h3>Implementation/rationale for it</h3>
<p >(Normally we omit impl details in public doc headers, but in this case the utility is low-level, and it may benefit you to know it.)</p>
<p >This builds in Linux only; it reads /proc/(pid)/cmdline (if it exists) and obtains the first NUL-terminated entry there. This is <code>argv[0]</code>. <code>argv</code> space may be overwritten by the process, so it could be something other than the original invocation. Ignoring that, it'll be whatever the command line included; could be absolute or not, normalized or not, the symlink or not... and so on. The tool <code>ps</code> uses the same technique.</p>
<p >One technique was considered: read Linux's /proc/(pid)/exe symlink which points to the absolute, normalized executable path actually invoked. That would have been perfect; however it appears to require admin privileges on our part, and we do not want to require this. On balance, since the original use case prompting this feature (<a class="el" href="structipc_1_1session_1_1App.html#ae82a8635858664720c8546e468f8090b" title="Absolute, lexically normalized canonical path to the executable entity (which is not a directory),...">session::App::m_exec_path</a> verification) is acceptably served by the less-demanding /proc/.../cmdline method, we chose that.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">err_code</td><td>See <code>flow::Error_code</code> docs for error reporting semantics. <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89" title="Short-hand for flow::Error_code which is very common.">Error_code</a> generated: some system error code; but most likely no-such-file error of some kind, indicating the process is not executing (any longer?). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The first entry &ndash; the executable &ndash; according to the process's command line (see above), if no <a class="el" href="namespaceipc.html#aa3192e586cc45d3e7c22463bf2760f89" title="Short-hand for flow::Error_code which is very common.">Error_code</a> is emitted. If one <em>is</em> emitted, without an exception (<code>err_code</code> not null), empty string. Caution: If error is <em>not</em> emitted, returned value <em>might</em> still be empty, if the process overrode its own command line (see above). </dd></dl>

</div>
</div>
<a id="ac1fb8e7a5663735405ca0c0bc29163c5" name="ac1fb8e7a5663735405ca0c0bc29163c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1fb8e7a5663735405ca0c0bc29163c5">&#9670;&nbsp;</a></span>user_id()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceipc_1_1util.html#a6435c1b48ec8684c24ca406d1d17208e">user_id_t</a> ipc::util::Process_credentials::user_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The user ID (UID). </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="aaf94b5903f4e0aa2f2699867dd8971ef" name="aaf94b5903f4e0aa2f2699867dd8971ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf94b5903f4e0aa2f2699867dd8971ef">&#9670;&nbsp;</a></span>operator!=()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>val1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>val2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Checks for by-value inequality between two <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> objects. </p>
<p ><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae4f156cfdfe0c8c5702890e5c1a37cdf" title="Obtains, from the OS, information as to the binary name via which process process_id() was started,...">process_invoked_as()</a> does not participate in this and is not invoked.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val1</td><td>Value to compare. </td></tr>
    <tr><td class="paramname">val2</td><td>Value to compare. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether at least one accessor compares unequal. </dd></dl>

</div>
</div>
<a id="a9da92514406dc1fc61f5a561c9b5aee9" name="a9da92514406dc1fc61f5a561c9b5aee9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9da92514406dc1fc61f5a561c9b5aee9">&#9670;&nbsp;</a></span>operator&lt;&lt;()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::ostream &amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Prints string representation of the given <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">util::Process_credentials</a> to the given <code>ostream</code>. </p>
<p ><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae4f156cfdfe0c8c5702890e5c1a37cdf" title="Obtains, from the OS, information as to the binary name via which process process_id() was started,...">process_invoked_as()</a> does not participate in this and is not invoked; you may query that information if desired manually; just remember <code>val.process_id()</code> must be live at the time for it to work.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">os</td><td>Stream to which to write. </td></tr>
    <tr><td class="paramname">val</td><td>Object to serialize. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>os</code>. </dd></dl>

</div>
</div>
<a id="a4ccdab04a79159f82d7ade8136a2eeb2" name="a4ccdab04a79159f82d7ade8136a2eeb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ccdab04a79159f82d7ade8136a2eeb2">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>val1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classipc_1_1util_1_1Process__credentials.html">Process_credentials</a> &amp;&#160;</td>
          <td class="paramname"><em>val2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Checks for by-value equality between two <a class="el" href="classipc_1_1util_1_1Process__credentials.html" title="A process&#39;s credentials (PID, UID, GID as of this writing).">Process_credentials</a> objects. </p>
<p ><a class="el" href="classipc_1_1util_1_1Process__credentials.html#ae4f156cfdfe0c8c5702890e5c1a37cdf" title="Obtains, from the OS, information as to the binary name via which process process_id() was started,...">process_invoked_as()</a> does not participate in this and is not invoked.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val1</td><td>Value to compare. </td></tr>
    <tr><td class="paramname">val2</td><td>Value to compare. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the accessors all compare equal. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>util/<a class="el" href="process__credentials_8hpp.html">process_credentials.hpp</a></li>
<li>util/<a class="el" href="process__credentials_8cpp.html">process_credentials.cpp</a></li>
<li>util/<a class="el" href="process__credentials__fwd_8hpp.html">process_credentials_fwd.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:23 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
